Skip to content

HBASE-29620 Refactor TestRSGroupsKillRS - #8623

Open
Sigma-Ma wants to merge 1 commit into
apache:masterfrom
Sigma-Ma:HBASE-29620-refactor-TestRSGroupsKillRS
Open

Sigma-Ma wants to merge 1 commit into
apache:masterfrom
Sigma-Ma:HBASE-29620-refactor-TestRSGroupsKillRS

Conversation

@Sigma-Ma

@Sigma-Ma Sigma-Ma commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

Split the mixed-version scenario into TestRSGroupsKillRSWithDifferentVersions. Use a test HMaster implementation to report a lower version for the target RegionServer, and restore VersionInfo#getVersion to return the generated version directly.

Why are the changes needed?

The existing test changes process-wide VersionInfo state through reflection. Since MiniCluster components run in the same JVM, this may affect unrelated servers and requires production code to keep mutable state only for testing.

How was this patch tested?

mvn -pl hbase-server -Dtest=TestRSGroupsKillRS,TestRSGroupsKillRSWithDifferentVersions -Dsurefire.failIfNoSpecifiedTests=false -Dsurefire.rerunFailingTestsCount=0 test

mvn -pl hbase-common -Dtest=TestVersionInfo -Dsurefire.rerunFailingTestsCount=0 test

* @return the hbase version string, eg. "0.6.3-dev"
*/
public static String getVersion() {
return version;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this change?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This mutable field was introduced only to let the test override the version through reflection. Since the test now simulates the lower version through HMaster, the field is no longer needed, so getVersion() can return Version.version directly again.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the only place where we override this field by reflection?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. I checked the repository, and TestRSGroupsKillRS#setVersionInfoVersion is the only place that modifies VersionInfo.version through reflection.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants